package com.aca.tool;
import java.util.Map;
import com.aca.entity.Admin;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionInvocation;
public class LoginFilter extends AbstractInterceptor{
    public String intercept (ActionInvocation arg0) throws Exception{
        Map session = arg0.getInvocationContext().getSession();
        Admin admin = (Admin)session.get("admin");
        if(admin==null){
            return Action.LOGIN;
        }
        return arg0.invoke();
    }
}
